package rifl.meres4.development.step.impl;

import rifl.meres4.commons.model.Software;
import rifl.meres4.commons.step.AbstractWorkflowStep;
import rifl.meres4.development.step.ISpecificationStep;

public class SpecificationStep extends AbstractWorkflowStep implements ISpecificationStep {

	private static int softwareCounter = 0;
	private static final String DEFAULT_PRODUCT_NAME = "AwesomeSoftware";
	private String softwareName;

	@Override
	public Software get() throws InterruptedException {
		String desiredName = DEFAULT_PRODUCT_NAME;
		if (this.softwareName != null && this.softwareName.length() > 0) {
			desiredName = this.softwareName;
		}
		return new Software(softwareCounter++, desiredName);
	}
	
	@Override
	public Software doStep(Software software) {
		return software;
	}

	@Override
	public void setSoftwareName(String softwareName) {
		this.softwareName = softwareName;
	}
	
	@Override
	public boolean hasInput() {
		return true;
	}

}
